<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Function Info.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>WinXDrawText</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<style type="text/css">
<!--
.style3 {font-size: medium}
-->
</style>

<link href="../../WinXStyles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {
	font-size: large;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<h1 class="style1"><img src="../../WinX48.png" width="48" height="48" align="absmiddle"> <!-- InstanceBeginEditable name="title" -->WinXDrawText<!-- InstanceEndEditable --></h1>
<hr>

<!-- InstanceBeginEditable name="Prototype" -->
<p>hElement = WinXDrawText (hWnd, hFont, STRING text, x, y, backCol, forCol)</p>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="Description" -->
<p>Draws some text on the specified window using the specified font and colours </p>
<!-- InstanceEndEditable -->
<table width="80%" border="1" cellpadding="0" cellspacing="0">
  <tr bgcolor="#CCCCCC">
    <th width="24%"><span class="style3">Parameter</span></th>
    <th width="76%"><span class="style3">Description</span></th>
  </tr>
  <!-- InstanceBeginRepeat name="Parameter Table" --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hWnd<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the window to draw the text on<!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->hFont<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The handle to the font to draw the text with <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->STRING text <!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The text to draw <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->x<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The x coordinate where the upper left hand corner of the text will be drawn <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->y<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The y coordinate where the upper left hand corner of the text will be drawn<!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->backCol<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The background colour for the text, -1 for none <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceBeginRepeatEntry -->
  <tr bgcolor="#E8E8E8">
    <td><!-- InstanceBeginEditable name="Parameter" -->forCol<!-- InstanceEndEditable --></td>
    <td><!-- InstanceBeginEditable name="Description" -->The foreground colour for the text <!-- InstanceEndEditable --></td>
  </tr>
  <!-- InstanceEndRepeatEntry --><!-- InstanceEndRepeat -->
</table>
<h3>Returns</h3>
<!-- InstanceBeginEditable name="Return Info" -->
<p>The id of the text or -1 on fail </p>
<!-- InstanceEndEditable -->
<h3>Remarks</h3>
<!-- InstanceBeginEditable name="Remarks" -->
<p>If you register the <a href="../Callbacks.htm/onPaint.htm">onPaint</a> callback, this function has no effect. This line will not be visible untill you call the <a href="WinXUpdate.htm">WinXUpdate</a> function. You can use the id returned by this function to undo the ellipse with the <a href="WinXUndo.htm">WinXUndo</a> function. </p>
<!-- InstanceEndEditable -->
<h3>Examples</h3>
<table width="80%"  border="0">
  <tr>
    <td bgcolor="#C6C6FF"><!-- InstanceBeginEditable name="Example Code" -->
      <p class="codeStyle">'First, get a logical font from the user<br>
      WinXDraw_GetFontDialog (#hMain, @logFont, @colour)</p>
      <p class="codeStyle">'Turn the logical font into a font object <br>
        hFont = CreateFontIndirectA (logFont)</p>
      <p class="codeStyle">'Now print some text<br>
      WinXDrawText (#hMain, hFont, &quot;Hello World!&quot;, 0, 0, -1, colour)        </p>
    <!-- InstanceEndEditable --></td>
  </tr>
</table>

<h2 class="style2">Related Links</h2>
<!-- InstanceBeginEditable name="Related Links" -->
<p><a href="../Text.htm/WinXDraw_MakeLogFont.htm">WinXDraw_MakeLogFont</a><br>
<a href="../Text.htm/WinXDraw_GetFontDialog.htm">WinXDraw_GetFontDialog</a><br>
<a href="../Text.htm/WinXDraw_GetTextWidth.htm">WinXDraw_GetTextWidth</a></p>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd --></html>
